; 取消alt+Esc快捷键功能
!Esc:: {
}

; 取消 Ctrl+CpasLock 快捷键功能
^CapsLock:: {

}


SetCapsLockState "AlwaysOff"
; RCtrl & CapsLock:: {
CapsLock & Space::{

    if GetKeyState("CapsLock", "T") = 1
        SetCapsLockState "AlwaysOff"
    else
        SetCapsLockState "AlwaysOn"
}

;以下为Capslock 组合功能键
CapsLock::Esc

CapsLock & -::Volume_Down
CapsLock & =::Volume_Up
CapsLock & 0::Media_Play_Pause
CapsLock & [::Media_Prev
CapsLock & ]::Media_Next

CapsLock & h::Left
CapsLock & j::Down
CapsLock & k::Up
CapsLock & l::Right
CapsLock & i::Home
CapsLock & o::End
CapsLock & u::PgUp
CapsLock & p::PgDn

CapsLock & c::^c
CapsLock & v::^v
CapsLock & z::^z
CapsLock & x::^x
CapsLock & a::^a
CapsLock & f::^f
CapsLock & y::^y
CapsLock & s::^s
CapsLock & /::^/

CapsLock & g:: Send "{AppsKey}"
CapsLock & q:: WinClose "A"
; CapsLock & q:: {
;     if GetKeyState("Alt") = 0
;     {
;         Send "^w"
;     } else {
;         t := WinExist("A")
;         if (t != "") {
;             WinClose "A"
;         }
;     }
; }

CapsLock & w::^Right
CapsLock & b::^Left

CapsLock & n::^BackSpace
CapsLock & m::BackSpace
CapsLock & ,:: Send "{Del}"
CapsLock & .:: ^Del

CapsLock & `;:: Send "{Enter}"

CapsLock & t::#+Left

; Mouse control
CapsLock & Up:: MouseMove(0, -10, 50, "R")
CapsLock & Down:: MouseMove(0, 10, 50, "R")
CapsLock & Left:: MouseMove(-10, 0, 50, "R")
CapsLock & Right:: MouseMove(10, 0, 50, "R")
; CapsLock & Enter:: MouseClick "L"
CapsLock & Enter:: {
    if GetKeyState("Alt") = 0
    {
        MouseClick "L"
    } else {
        MouseClick "R"
    }
}
; CapsLock & Space:: CapsLock
; 快速切换,辅助快捷键
~!j::^PgUp
~!k::^PgDn
~!q::^w
!t::^+t
; 特殊字符 快速打印出来
^!o::Ω
^!p::℃
^!u::μ

; 自定义透明度 win = win -加减
#=:: chWinTrans(10)
#-:: chWinTrans(-5)
chWinTrans(i) {
    t := WinGetTransparent("A")
    if (t = "") {
        t := 255
    }
    else {
        t := t + i
    }
    if t > 255 or t < 0
        t := 255
    WinSetTransparent t, "A"
    return
}
#HotIf WinActive("ahk_exe msedge.exe")

#HotIf

#HotIf WinActive("ahk_exe Obsidian.exe")
#HotIf

#HotIf WinActive("ahk_exe UV4.exe")
#HotIf

#HotIf WinActive("ahk_exe uTools.exe")
#HotIf

#HotIf WinActive("ahk_exe Code.exe")
#HotIf
